package com.supeng.PMdepot.adapter;

import android.text.TextUtils;
import android.text.method.ScrollingMovementMethod;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.supeng.PMdepot.R;
import com.supeng.PMdepot.entity.RukuBeen;

/**
 * 盘点
 * Created by Supeng on 2018/8/23.
 */
//Caption been
public class PanDianAdapter extends BaseQuickAdapter<RukuBeen, BaseViewHolder> {

    public PanDianAdapter() {
        //item layout
        super(R.layout.layout_pandian_item);
    }
    //设置控件数据
    @Override
    protected void convert(final BaseViewHolder helper, RukuBeen item) {
        helper.setText(R.id.tv_cptm, "产品条码:" + item.getCptiaoma());
        helper.setText(R.id.tv_cpname,"产品名称:"+item.getChanpin());
        TextView tvCpname=helper.getView(R.id.tv_cpname);
        tvCpname.setMovementMethod(ScrollingMovementMethod.getInstance());
        tvCpname.setHorizontallyScrolling(true);
        helper.setText(R.id.tv_cpCount,"产品数量:"+item.getShuliang());
        helper.setText(R.id.tv_cangwei,"仓位:"+ (!TextUtils.isEmpty(item.getNewCangwei())?item.getNewCangwei():item.getCangwei()));
        helper.setVisible(R.id.iv_gou,item.isShow());
    }
}
